home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / WIN_PRO / WNDLIB10.ZIP;1 / README.TXT < prev    next >
Encoding:
Text File  |  1994-03-25  |  16.6 KB  |  476 lines

  1.  
  2.                   Wndlib 1.0
  3.  
  4.  
  5. INTRODUCTION        
  6. ============
  7.  
  8.     Wndlib is a C++ class library for Microsoft Windows. For the most
  9. part (with the exception of the file I/O and printing dialog-boxes and 
  10. functions) it is implemented in header files. This means no linking, no 
  11. extra code, and no worrying about memory modules. There are curently over 37
  12. classes, most of which were created for use creating commercial quality 
  13. Windows programs. Burnham Park Software, Inc. is committed to constantly 
  14. upgrading and enhancing Wndlib. The price of registration will go up with 
  15. new enhancements so if Wndlib is useful, register now. Note: Wndlib has been
  16. tested with Borland C++ 3.1 and 4.0. There is no reason (with minor 
  17. modifications) that it would not work with Visual C++ or Symantec C++. It has 
  18. also been designed to co-exist or supplement other class libraries such as 
  19. Borlands OWL or Microsoft's Foundation classes.
  20.  
  21.  
  22. INSTALLATION
  23. ============
  24.     
  25.     STEP ONE: Copy the files WNDCLASS.H and WNDDB.H to your compiler's 
  26. include directory. For example:
  27.  
  28.         copy c:\xtalk\fil\wnd*.h c:\cpp\include
  29.  
  30.     STEP TWO: Copy the remaining files to the desired directory so that 
  31. they maybe examined and compiled. For example:
  32.     
  33.         copy c:\xtalk\fil\*.* c:\cpp\src\test
  34.  
  35.  
  36. File list
  37. =========
  38.  
  39.     This is a complete file list.
  40.  
  41.         WNDCLASS.H - the main header file.
  42.  
  43.         WNDDB.H - the I/O dialog-box header file.
  44.  
  45.         WNDDB.OBJ - the I/O dialog-box object file.
  46.  
  47.         WNDDB.RES - the I/O dialog-box resource file.
  48.  
  49.         WNDEX.H - the example program header file.
  50.  
  51.         WNDEX.CPP - the example program main file.
  52.  
  53.         WNDEX.RC - the example program resource file.
  54.  
  55.         WNDEX.DEF - the example program definition file.
  56.  
  57.         WNDEX.IDE - the example program Borland C++ 4.0 IDE.
  58.  
  59.         WNDEX.EXE - the example program executable.
  60.  
  61.         WNDEX.MAK - the example program make file.
  62.  
  63.         README.TXT - this text file.
  64.  
  65.         FILE_ID.DIZ - Wndlib ID file.
  66.  
  67.         ORDER.FRM - Wndlib order form.
  68.  
  69.  
  70. USING THE LIBRARY
  71. =================
  72.  
  73.     Wndlib is composed of two parts (with more to be added in future 
  74. versions). The first is the WNDCLASS.H header file. This may be easily added 
  75. to any C++ Windows program file by an include statement such as in this 
  76. example:
  77.  
  78.         #include <wndclass.h>
  79.  
  80. This will automatically give the programmer access to all of the classes
  81. available in WNDCLASS.H without having to link anything in later. An example 
  82. of a class is the GLOBALMEMORY_CLASS. This class simplifies allocating and
  83. freeing memory under Windows. An example of a function that uses 
  84. GLOBALMEMORY_CLASS follows:
  85.  
  86.         void count(){
  87.           int i, j;
  88.           GLOBALMEMORY_CLASS array;  // Declare array
  89.           array.Allocint(20);  // Allocate array
  90.           array.Lock();  // Lock in memory
  91.           for(i = 0; i < 20; i++) array.Setint(i, 0);  // Initialize
  92.           for(i = 0; i < 100; i++){
  93.             j = random(20);
  94.             array.Setint(j, array.Getint(j) + 1);  // Increment
  95.           }
  96.           array.Unlock();  // Unlock
  97.           array.Free();  // Free
  98.         }
  99.  
  100. This function doesn't do very much, but it illustrates the ease of using C++ 
  101. classes over using standard C.
  102.  
  103.     The second part of Wndlib is the WNDDB I/O dialox-box functions. The
  104. WNDDB.H header file is necessary along with the WNDDB.OBJ and WNDDB.RES files
  105. (which must be linked into the program). The WNDDB part of the library contains
  106. two different File-Open and File-Save as dialog-boxes plus the functions to
  107. manipulate them.
  108.  
  109.  
  110. REFERENCE GUIDE
  111. ===============
  112.  
  113.     This is not a complete or comprehensive reference guide. The complete 
  114. reference guide is very long (it is contained in the printed manual) so only 
  115. a condensed version is listed here. The classes in WNDCLASS.H are only types 
  116. and must be defined in your program. The classes in WNDDB.H are already 
  117. defined and may be used if WNDDB.H is included in your program and WNDDB.OBJ 
  118. and WNDDB.RES are linked with it.
  119.  
  120.                 WNDCLASS.H
  121.  
  122. BASEWINDOW_CLASS        Class that manipulates window handles (HWND).
  123.         
  124.     HWND Get()          Returns the window handle.
  125.     void Set(HWND)      Sets the window handle.
  126.     BOOL Show()         Shows window in normal state.
  127.     LONG SendMessage(UINT, WPARAM, LPARAM)
  128.             Sends message to window.
  129.     void GetRect(RECT*) Gets window's screen coordinates.
  130.     
  131. WINDOW_CLASS            Class that is used to create windows.
  132.         
  133.     WINDOWCLASS(HINSTANCE, LPSTR)
  134.             Constuctor that sets up window.
  135.     void Create()       Creates window using defaults.
  136.     void dwStyle(DWORD) Set style flags.
  137.     
  138. WINDOWMESSAGE_CLASS     Class used for the message loop.
  139.  
  140.     int TranslateAccel(HANDLE)
  141.             Used in message loop to handle accel.
  142.     int TestMessage()   Test for message.
  143.     void DoMessage()    Translates and dispatches message.
  144.         
  145. WINDOWACCEL_CLASS       Class used to handle accelerators.
  146.  
  147. EDITWINDOW_CLASS        Class for edit child windows.
  148.  
  149. BUTTONWINDOW_CLASS      Class for button child windows.
  150.  
  151. LISTBOXWINDOW_CLASS     Class for listbox child windows.
  152.  
  153. DIALOGBOXWINDOW_CLASS   Class for handling dialog-boxes.
  154.  
  155.     void CheckButton(int)   
  156.             Checks a checkbox control.
  157.     void UncheckButton(int) 
  158.             Unchecks a checkbox control.
  159.     void CheckRadio(int, int, int)
  160.             Checks a radio button.
  161.     void GetText(int, LPSTR)
  162.             Gets a character string.
  163.     void ListboxInsert(int, LPSTR)
  164.             Inserts a string into a listbox.
  165.  
  166. MDICLIENTWINDOW_CLASS   Class for MDI client windows.
  167.  
  168. MDICHILDWINDOW_CLASS    Class for MDI child windows.
  169.  
  170. MOVEWINDOW_CLASS        Class for moving and centering windows.
  171.  
  172. WND_CLASS               Class for creating and registering classes.
  173.  
  174. INSTANCE_CLASS          Class to store and manipulate hinstance.
  175.  
  176. LOCALMEMORY_CLASS       Class facilitate local memory allocation.
  177.  
  178. LOCALARRAY_CLASS        Class to handle local two-dimensional arrays.
  179.  
  180. LOCALSTRUCT_CLASS       Class to handle local dynamic structures.
  181.  
  182. GLOBALMEMORY_CLASS      Class to handle global memory allocation.
  183.  
  184.     int Allocchar(DWORD)    
  185.             Allocates a block of characters.
  186.     int Allocint(DWORD) Allocates a block of integers.
  187.     int Allocfloat(DWORD)   
  188.             Allocates a block of floats.
  189.     void Lock()         Locks block in memory.
  190.     void Unlock()       Unlocks block in memory.
  191.     void Free()         Frees block.
  192.     int Getint(int)     Retrieves an integer.
  193.     void Setint(int, int)   
  194.             Sets the value of an integer.
  195.  
  196. GLOBALARRAY_CLASS       Class to handle global two-dim. arrays.
  197.  
  198.     int Allocint(int, int)  
  199.             Allocates a int x int block.
  200.     int Getint(int, int) 
  201.             Retrieves an integer.
  202.     void Setint(int, int, int)
  203.             Sets the value of an integer.
  204.  
  205. GLOBALSTRUCT_CLASS      Class to handle global structures.
  206.  
  207.     GLOBALSTRUCT_CLASS(int) 
  208.             Constructor determines struct size.
  209.     int Alloc(int)      Allocates int structures.
  210.     void Free()         Frees memory block.
  211.     void Add()          Adds a new structure.
  212.     void Remove()       Removes a structure.
  213.     void Insert()       Inserts a structure.
  214.     void Remove()       Removes a structure.
  215.     void First()        Moves pointer to first structure.
  216.     void Last()         Moves pointer to last structure.
  217.     void Next()         Moves pointer to next structure.
  218.     void Prev()         Moves pointer to previous structure.
  219.     LPSTR Getp_struct(int)  
  220.             Returns pointer to structure.
  221.     LPSTR Getp_struct() Returns pointer to current structure.
  222.  
  223. DIALOGBOX_CLASS         Class to call up and display dialog-boxes.
  224.  
  225.     DIALOGBOX_CLASS(HINSTANCE)       
  226.             Constructor takes hinstance as arg.
  227.     DialogBox(HWND, FARPROC, LPSTR)
  228.             Simplifies calling a dialog-box.
  229.  
  230. FILE_CLASS              Class to handle file I/O.
  231.     int OpenRead(LPSTR) Opens file for reading.
  232.     int OpenWrite(LPSTR)    
  233.             Opens file for writing.
  234.     char Readchar()     Reads a character.
  235.     inr Readint()       Reads an integer.
  236.     float Readfloat()   Reads a float.
  237.     void ReadBuffer(LPSTR, int)
  238.             Reads bytes into a buffer.
  239.     void Writechar(char)
  240.             Writes a character.
  241.     void Writeint(int)  Writes an integer.
  242.     void Writefloat(float)  
  243.             Writes a float.
  244.     void WriteBuffer(LPSTR, int)
  245.             Writes bytes from a buffer.
  246.     void Close()        Closes a file.
  247.  
  248. TIMER_CLASS             Class to setup a timer
  249.  
  250.     TIMER_CLASS(HINSTANCE)  
  251.             Constuctor takes hinstance as arg.
  252.     void Set(HWND, int, FARPROC)
  253.             Creates a timer with a callback func.
  254.     void Setmessage(HWND, int)
  255.             Creates a timer as a WM_TIMER message.
  256.     void Kill()         Kills timer.
  257.  
  258. CURSOR_CLASS            Class to manipulate the cursor.
  259.  
  260.     HCURSOR Get()       Retrieves current cursor handle.
  261.     void Set(HCURSOR)   Sets current cursor.
  262.     void Show()         Shows current cursor.
  263.     void Hide()         Hides current cursor.
  264.     void SetARROW()     Sets cursor to arrow.
  265.     void SetWAIT()      Sets cursor to timer.
  266.     void SetCROSS()     Sets cursor to crosshair.
  267.     void SetUPARROW()   Sets cursor to up arrow.
  268.     void SetSIZENWSE()  Sets cursor to size arrows.
  269.     void Restore()      Restores old cursor.
  270.     void Destroy()      Destroys cursor.
  271.  
  272. MOUSE_CLASS             Class to handle mouse coordinates.
  273.  
  274.     MOUSE_CLASS(HWND)   Constuctor takes window as arg.
  275.     void GetClientPos() Retrieves mouse position in client.
  276.     int Getx()          Retrieves x coordinate of mouse.
  277.     int Gety()          Retrieves y coordinate of mouse.
  278.  
  279. MENU_CLASS              Class to manipulate menus.
  280.  
  281.     MENU_CLASS(HWND)    Constructor get menu from window.    
  282.     MENU_CLASS(HINSTANCE, HWND, LSPTR)
  283.             Constructor loads menu.
  284.     void Get()          Retieves menu from window.
  285.     void Set()          Sets window's menu.
  286.     int GetState(int, int)      
  287.             Retrieves state of menu item.
  288.     int GetState(int)   Retrieves state of menu item by command.
  289.     void CheckItem(int, int)
  290.             Checks menu item.
  291.     void EnableItem(int int)
  292.             Enables menu item.
  293.  
  294. HELP_CLASS              Class to load and display help file.
  295.  
  296.     HELP_CLASS(HWND, LPSTR)
  297.             Constuctor takes window and name of help file.
  298.     void HelpIndex()    Opens help file's index (or contents).
  299.     void Help(int)      Opens a help file topic.
  300.  
  301. BASEDC_CLASS            Base class for device contexts.
  302.  
  303.     HDC GetHDC()        Retrieves HDC.
  304.     void SetHDC()       Sets HDC.
  305.     void Delete()       Deletes current HDC.
  306.     void Compatible(HDC)
  307.             Creates a compatible HDC.
  308.     HANDLE Select(HANDLE)
  309.             Selects an object into the HDC.
  310.     void Line(int, int, int, int)
  311.             Draws line.
  312.  
  313. DC_CLASS                Class for DC's connected to windows.
  314.  
  315.     DC_CLASS()          Contructor.
  316.     DC_CLASS(HWND)      Constructor that attaches DC to a window.
  317.     void Get()          Gets a DC based on the current window.
  318.     void Get(HWND)      Gets a DC based on the supplied window.
  319.     void Release()      Releases DC.
  320.  
  321. PAINT_CLASS             Class based on PAINTSTRUCT.
  322.  
  323.     void Begin(HWND)    Opens the PAINTSTRUCT to paint the DC.
  324.     void End()          Closes the PAINTSTRUCT.
  325.     int Getleft()       Retrieves the left x-coordinate of the paint rect.
  326.     int Getright()      Retrieves the right x-coordinate of the paint rect.
  327.     int Gettop()        Retrieves the top y-coordinate of the paint rect.
  328.     int Getbottom()     Retrieves the bottom y-coordinate of the paint rect.
  329.  
  330. TEXT_CLASS              Class to manipulate text metrics.
  331.  
  332.     void Get(HDC)       Retrieves text metrics.
  333.     int GetHeight()     Retrieves text height.
  334.  
  335. BRUSH_CLASS             Class to manipulate brushes.
  336.  
  337.     CreateSolid(int, int, int)
  338.             Creates a solid brush based on RGB values.
  339.     HANDLE Select()     Selects current brush into DC.
  340.     void Delete()       Deletes current brush.
  341.     void SelectDelete() Selects then deletes current brush.
  342.     void SelectSolid(int, int, int)
  343.             Creates brush then selects into DC.
  344.  
  345. PEN_CLASS               Class to manipulate pens.
  346.  
  347.     void CreatePen(int, int COLORREF)
  348.             Creates pen with style, width, and color specified.
  349.     void CreateSolid(int, COLORREF)
  350.             Create solid pen with width and color specified.
  351.     HANDLE Select()     Selects pen into DC.
  352.     void Delete()       Deletes current pen.
  353.     void SelectDelete() Selects then deletes current pen.
  354.     void SelectSolid(int, int, int)
  355.             Creates solid pen then selects into DC.
  356.  
  357. BRUSHPEN_CLASS          Class to manipulate both pens and brushes.
  358.  
  359.     void CreateSolid(COLORREF)
  360.             Creates solid pen and brush and selects into DC.
  361.     void Select()       Selects pen and brush into DC.
  362.     void Delete()       Deletes current pen and brush.
  363.     void SelectDelete() Selects then deletes current pen and brush.
  364.     void SelectSolid(int, int, int)
  365.             Creates solid pen and brush then selects into DC.
  366.  
  367. BITMAP_CLASS            Class to manipulates bitmaps and facilitate BitBlt.
  368.  
  369.     BITMAP_CLASS()      Constructor without window handle.
  370.     BITMAP_CLASS(HWND)  Constructor with window handle.
  371.     HDC GetHDCMEM()     Retrieves handle to memory device context.
  372.     HBITMAP GetHBITMAP()
  373.             Retrieves handle to bitmap.
  374.     void Setbitmap(HBITMAP)
  375.             Sets handle to bitmap.
  376.     void Setup()        Create memory device context and get dimensions.
  377.     void Cleanup()      Cleans up mem DC and bitmap.
  378.     void Draw(int, int, int, int)
  379.             Draw the bitmap at x, y with dimensions of dx & dy.
  380.     void Stretch(int, int, int, int, int, int)
  381.             Draw the bitmap while forcing it to fit in a rect.
  382.  
  383. BITMAPCONVERT_CLASS     Class to convert bitmaps from a coordinate system.
  384.  
  385. FONT_CLASS              Class to manipulate fonts.
  386.  
  387. PRINT_CLASS             Class to help use the Windows printing system.
  388.  
  389.                 WNDDB.H
  390.  
  391. FILEDB_CLASS            Class that handles the dialox-boxes for file I/O.
  392.  
  393.     FILEDB_CLASS()      Constructor that initializes the default spec to *.*.
  394.     FILEDB_CLASS(char *)
  395.             Constructor that sets the default spec.
  396.     char *Getfilespec() Retrieves file spec.
  397.     char *Getfilename() Retrieves filename.
  398.     char *Getdefaultspec()
  399.             Retrieves default spec.
  400.     char *Getcaption()  Retrieves dialog-box caption.
  401.     char *Getdescription()
  402.             Retrieves file description.
  403.     int Gethead()       Retrieves file header.
  404.     int Getflag()       Retrieves file flag.
  405.     HANDLE Gethinstance()
  406.             Retrieves hinstance.
  407.     void Setdefaultspec(char *)
  408.             Sets the default file spec.
  409.     void Setcpation(char *)
  410.             Sets the dialog-box caption.
  411.     void Setdescription(char *)
  412.             Sets the file description.
  413.     void Setapplicationname(char *)
  414.             Sets the program's name.
  415.     void Sethinstance(HANDLE)
  416.             Sets the hinstance.
  417.     void parsefilename(LPSTR, LPSTR)
  418.             Parses a string to retrieve a valid filename.
  419.     void DescriptionList(HWND)
  420.             Fill a description listbox.
  421.     int FileOpen(HWND, int)
  422.             Open a file picked from the FileOpen dialog-box.
  423.     int FileOpen(HWND)
  424.             Open a file with defaults.
  425.     int FileSaveas(HWND, int)
  426.             Save a file using the FileSave as dialog-box.
  427.     int FileSaveas(HWND)
  428.             Save a file with defaults.
  429.     int DescriptionOpen(HWND, int)
  430.             Open a description file.
  431.     int DescriptionOpen(HWND)
  432.             Open a description file with defaults.
  433.     int DescriptionSaveas(HWND, int)
  434.             Save a description file.
  435.     int DescriptionSaveas(HWND)
  436.             Save a description file with defaults.
  437.     int FileMessage(HWND, int)
  438.             Display a file I/O related message.
  439.     int FileRead(HWND)  Start reading from a file.
  440.     int FileWrite(HWND) Start writing to a file.
  441.  
  442. PRINTDB_CLASS           Class to handle printing.
  443.  
  444.  
  445. REGISTERING WNDLIB
  446. ==================
  447.  
  448.     WNDLIB is shareware which means that WNDLIB was distributed freely in 
  449. order to allow people to "test drive" it. The try-before-you-buy concept 
  450. allows users to find out which programs are useful before purchasing them. If 
  451. a shareware program is useful or entertaining, please support it through 
  452. registration. The registration fee for WNDLIB is only $22. Registration 
  453. entitles you to the newest version of the program, a Windows 3.1 hypertext
  454. help file, a printed manual, customer support (through the mail or on 
  455. Compuserve), an account on our BBS, an unlimited distribution license, source
  456. code and information (and discounts) on other offerings from Burnham Park
  457. Software, Inc. To register, send a check or money order to:
  458.         
  459.         Burnham Park Software, Inc.
  460.         P.O. Box #814
  461.         Chicago, IL 60690-0814
  462.  
  463.         Phone: (312) 922-6313
  464.         BBS: (312) 922-2839     
  465.         Compuserve: 71532,3271
  466.         AOL: J null B
  467.         Delphi: MARBRO
  468.         GEnie: XRG36978
  469.         Internet: jnullb@aol.com
  470.  
  471.     Wndlib is supplied as is. The author disclaims all warranties, 
  472. expressed or implied, including, without limitation, the warranties of 
  473. merchantability and of fitness for any purpose. The author assumes no 
  474. liability for damages, direct or consequential, which may result from the use 
  475. of WNDlib.
  476.